﻿using J1502B.ZXMSC.Common;
using DataAccess.SqlClient;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace J1502B.ZXMSC.DAL
{

    public abstract class SQlDALBase<T> : IDAL.IDALBase<T> where T : Model.ModelBase
    {
        /// <summary>
        /// 插入一条数据
        /// </summary>
        /// <param name="info">实体对象</param>
        /// <returns>插入的数据的标识</returns>
        public int InsertInfo(T info)
        {
            return 0;
        }

        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        public List<T> Show()
        {
            SqlQuery sql = new SqlQuery();
            sql.CommandText = string.Format("select * from Menu");
            DataSet ds = SqlDataAccess.ExecDataset(sql);
            return DataReaderToObjectHelper.DataTableToList<T>(ds.Tables[0]);
        }
    }
}
